// clean-this-file
:root {
	--sidebar-hover-color: #f3f3f3;
	--sidebar-active-color: rgba(255, 255, 255, 1);
	--sidebar-border-color: #ededed;
	--surface-modal: rgba(255, 255, 255, 1);
	--divider-color: rgba(237, 237, 237, 1);
	--sidebar-width: 220px;
	--left-sidebar-width: 220px;
}
[data-theme="dark"] {
	--sidebar-hover-color: rgba(43, 43, 43, 1);
	--sidebar-active-color: rgba(66, 66, 66, 1);
	--sidebar-border-color: #232323;
	--surface-modal: rgb(0, 0, 0);
	--divider-color: rgba(52, 52, 52, 1);
}
.underline-hover {
	display: initial;
}
.hide-form-sidebar {
	.form-sidebar {
		display: none !important;
	}
}

.sidebar-padding {
	padding: 12px 14px;
}

body[data-route=""] .main-menu,
body[data-route="desk"] .main-menu {
	@extend .hide-form-sidebar;
}

body[data-route^="List"] .main-menu {
	.list-sidebar {
		display: block !important;
	}

	@extend .hide-form-sidebar;
}

body[data-route^="Module"] .main-menu {
	.module-sidebar {
		display: block !important;
	}

	@extend .hide-form-sidebar;
}

body {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	justify-content: flex-start;
	position: relative;
}

.main-section {
	width: 100%;
	height: 100vh;
	overflow: scroll;
	overflow-x: hidden;
	overflow-y: visible;
	scrollbar-gutter: stable;
}

.body-sidebar-container {
	display: flex;
	flex-direction: column;
	height: fit-content;
	width: fit-content;

	.body-sidebar-placeholder {
		display: none;
		width: 50px;
		height: 100vh;
	}
}

.body-sidebar {
	width: 50px;
	background: var(--subtle-accent);
	border-right: 1px solid var(--sidebar-border-color);

	display: flex;
	flex-direction: column;
	height: 100vh;
	z-index: 1030;
	padding: 8px 8px 10px 8px;

	.body-sidebar-top {
		flex: 1 1;
		padding: 1px;
		width: 34px;
		display: flex;
		align-items: flex-start;
		flex-direction: column;
		flex-wrap: nowrap;

		gap: 2px;
		overflow: hidden;
		position: static;
		font-size: var(--text-base);
		// transition: width 200ms;
	}

	.body-sidebar-bottom {
		overflow: hidden;
		padding: 7px;
		width: 30px;
		height: 30px;
		// position: relative;
		// top:10px;
	}
	.app-title {
		font-weight: 500;
		line-height: 16.1px;
	}
	.app-logo {
		width: 32px;
		height: 32px;
	}

	.divider {
		margin: var(--margin-xs) 0;
		border-top: 1px solid var(--divider-color);
	}

	.standard-sidebar-section {
		margin-bottom: var(--margin-xl);
		display: flex;
		flex-direction: column;

		&:last-of-type {
			margin-bottom: var(--margin-sm);
		}

		&:first-child {
			margin-top: 24px;
		}

		.sidebar-item-container {
			width: 30px;
			margin-bottom: 2px;
		}
	}

	.standard-sidebar-item {
		display: flex;
		line-height: 0px;
		padding: 0px;
		.sidebar-item-control {
			display: none;

			> * {
				align-self: center;
				// margin-left: 3px;
				// box-shadow: none;
			}

			.drop-icon {
				width: 28px;
				height: 28px;
				padding: 6px;
			}

			svg {
				margin: -4px;
			}
		}

		.sidebar-item-label {
			display: none;
			font-size: var(--text-md);
		}

		.item-anchor {
			line-height: 10px;
			display: flex;
			overflow: hidden;
			gap: 5px;
			align-items: center;
			// padding: 3px 0px 3px 11px;
			flex: 1;

			&:hover {
				text-decoration: none !important;
			}

			.sidebar-item-icon {
				padding: 7px;

				width: 30px;
				height: 30px;

				svg {
					width: 16px;
					height: 16px;
				}
			}
		}
	}

	.collapse-sidebar-link {
		width: 2px;
		height: 12px;
		visibility: collapse;
		text-decoration: none;
		font-size: var(--text-md);
		svg {
			width: 16px;
			height: 16px;
		}
	}

	.collapse-sidebar-link svg {
		visibility: visible;
	}

	.sidebar-item-container {
		width: 30px;
		position: relative;
		// &:hover{
		// 	background-color: #f3f3f3;
		// 	border-radius: 8px;
		// }
		// margin-left: -10px;
		// margin-bottom: 6px;
		/* nested container */
		.sidebar-item-container {
			padding-left: 12px;

			.standard-sidebar-item {
				justify-content: start;
			}
		}
	}
}

@mixin body-sidebar-expanded {
	.body-sidebar {
		// make it an overlay on hover
		position: absolute;
		width: var(--left-sidebar-width);
		.app-switcher-dropdown {
			width: 100%;
			left: 0px;
			padding: 3px;
		}
		.body-sidebar-top {
			width: 100%;
			overflow-y: hidden;
		}
		.sidebar-item-container {
			width: 100%;
		}
		.sidebar-item-label {
			display: flex;
			align-items: center;
		}
		.sidebar-item-control {
			display: block;
		}

		.sidebar-items {
			padding: 0px;
			width: 100%;
		}
		.collapse-sidebar-link {
			visibility: visible;
		}
		.body-sidebar-bottom {
			width: 100%;
			position: static;
		}
	}

	// show placeholder so that main section remains static
	.body-sidebar-placeholder {
		display: flex;
		width: var(--left-sidebar-width);
	}
}

.body-sidebar-container.expanded {
	@include body-sidebar-expanded();
}

@include media-breakpoint-down(sm) {
	// body sidebar hidded in mobile view
	.body-sidebar-container {
		.body-sidebar {
			padding: 0px;
			width: 0px;
			overflow: hidden;
		}
	}

	// expands when navbar-brand is clicked
	.body-sidebar-container.expanded {
		position: relative;
		.body-sidebar {
			padding: 8px 8px 10px 8px;
			width: var(--left-sidebar-width);
			height: 100%;
			position: absolute;
			bottom: 0;
			top: 0;
		}
		.overlay {
			display: block;
			position: absolute;
			width: calc(100vw - var(--sidebar-width));
			height: 100%;
			z-index: 1021;
			left: var(--left-sidebar-width);
			overflow: auto;
			background-color: rgba(128, 128, 128, 0.5);
		}

		// acts a overlay when in mobile view
		.body-sidebar-placeholder {
			display: flex;
			width: 0px;
		}
	}
}

.app-switcher-dropdown {
	position: relative;
	text-decoration: none;
	width: 38px;
	height: 38px;
	padding: 3px;
	margin-left: -2px;
	.standard-sidebar-item {
		padding-top: 1px;
		padding-bottom: 1px;
		.d-flex {
			width: 161px;
		}
		gap: 30px;
	}
	.sidebar-item-control {
		margin: 2px;
		margin-right: 0px;
	}
}

.app-switcher-menu {
	position: absolute;
	top: 50px;
	left: 9px;
	width: 208px;
	padding: 6px;
	border-radius: var(--border-radius-lg);
	background: var(--surface-modal);
	box-shadow: var(--shadow-xl);
	z-index: 1;
}

.app-item {
	// padding: var(--padding-xs);
	border-radius: var(--border-radius-tiny);
	opacity: 0px;
	&:hover {
		background-color: var(--sidebar-hover-color);
	}

	a {
		width: 208px;
		height: 28px;
		padding: 6px 8px 6px 8px;
		gap: 8px;
		text-decoration: none;
		display: flex;
		align-items: center;
		gap: var(--margin-sm);
		.sidebar-item-icon {
			line-height: 0px;
			.app-logo {
				width: 16px;
				height: 16px;
			}
		}
	}

	.app-item-title {
		text-overflow: ellipsis;
		text-wrap: nowrap;
		overflow: hidden;
	}
}
// sidebar-item states
@mixin hover-mixin {
	background-color: var(--sidebar-hover-color);
	border-radius: 8px;
}

.hover {
	@include hover-mixin();
}

.active-sidebar {
	background: var(--sidebar-active-color);
	box-shadow: var(--shadow-sm);
	border-radius: 8px;
}
.overlay {
	display: none;
}
